import App from './App'
import store from './store'
import plugin from './js_sdk/uni-admin/plugin'
import 'element-plus/dist/index.css'
import dbrequist from './common/dbrequist.js'

import ElementPlus from 'element-plus'

// 通用方法
import Request from '@/common/request.js';
import autoPagination from '@/common/utils/autoPagination.js';
import UniMethosUtils from "@/common/utils/uniMethosUtils.js";
import utils from '@/common/utils/utils.js'
const zhttp = new Request();
const zuniMethosUtils = new UniMethosUtils();
const zutils = new utils();
// Vue.prototype.$store = store;
// Vue.prototype.$db = dbrequist;



// #ifndef VUE3
import Vue from 'vue'
Vue.config.productionTip = false
Vue.use(plugin)

App.mpType = 'app'
const app = new Vue({
	store,
	...App
})
app.$mount()
// #endif

// #ifdef VUE3
import {
	createSSRApp
} from 'vue'
export function createApp() {
	const app = createSSRApp(App)
	app.use(plugin)
	app.use(store)
	app.config.globalProperties.$db = dbrequist;
	app.use(ElementPlus);
	// 通用方法
	app.config.globalProperties.$http = zhttp.Request;
	app.config.globalProperties.$https = zhttp;
	app.config.globalProperties.$autoPage = autoPagination;
	app.config.globalProperties.$uniMethosUtils = zuniMethosUtils;
	app.config.globalProperties.$utils = zutils;
	return {
		app
	}
}
// #endif
